<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit" />
<script type="text/javascript">
    var base = "${base}";
    var pathUrl= "${request.requestURL}";
</script>
<meta name="description" content="${p2p_get_global('webname')}" />
<meta name="keywords" content="${p2p_get_global('keywords')}" />
<title>${p2p_get_global('webname')}</title>
<script src="${path}/resources/wap/js/cite/jquery-1.9.1.min.js"></script>
<script src="${path}/resources/wap/js/cite/base.js"></script>
<link rel="stylesheet" href="${path}/resources/wap/css/base/base.css"/>
<link href="${path}/resources/plug/layui/css/layui.mobile.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="${path}/resources/wap/css/load/dropload.min.css"/>

<script src="${path}/resources/plug/layui/layui.js" type="text/javascript"></script>
<style>


    #goBack{
        margin-bottom: 0.65rem;
    }

</style>
<script>
    function toast(message){
        layer.msg(message);
    }
    $(document).ready(function(){
        $("#goBack").click(function(){

        history.go(-1);
    });
    });

    layui.define(['layer'], function (exports) {
                var layer = layui.layer;

                exports('msg', function (msg,url) {
                    layer.msg(msg,{shade:0.3,time:1000},function(){
                        if(url == "reload"){
                            window.location.reload();
                        }else if(url)  location.href = url;
                    });
                });

                exports('alert', function (msg) {
                    layer.msg(msg);
                });

                exports('confirm', function (msg,callback) {
                    layer.confirm(msg, function(index){
                        if(callback)  callback();
                        layer.close(index);
                    });
                });



            }
    );
    function ajax(options){
        var p = options || {};
        var url = p.url;
        $.ajax({
            cache: false,
            async: p.async == undefined ? true : p.async,
            url: url,
            data: p.data,
            dataType: p.dataType || 'json',
            traditional:true,
            type: p.type || 'POST',
            beforeSend: function () {
                if(options.beforeSend){
                    options.beforeSend();
                }
            },
            complete: function () {
                if (options.complete) {
                    options.complete();
                }
            },
            success: function (result) {
                if (p.success){
                    p.success(result);
                }else{
                    layer.alert(result.msg);
                }
            },

            error: function (xhr,status) {
                //报错时，不执行complete
                options.loading = false;
                var showError = p.showError || true;

                if(p.error){
                    p.error(xhr,status);
                }
                if(xhr.status == 403){
                    // window.location = base + "/login.jhtml";
                    Login.login().dialogLogin();

                }else if(showError){
                    if (options.error) {
                        options.error();
                    }


                    if(xhr.status == 400){
                        var responseError = eval(xhr.responseText);
                        var info = '';
                        for(var i = 0;i < responseError.length;i++){
                            info += responseError[i] + '<br/>';
                        }
                        if(!("undefined" == typeof layer)) {
                            layer.msg(info);
                        }else{
                            layer.msg(info, true);
                        }
                    }else{
                        layer.msg('系统出错');
                    }
                }


                ;
            }
        });
    }


</script>

